package br.com.o2solutions.core.test.business.rule;

import org.springframework.stereotype.Component;

import br.com.o2solutions.core.exception.BusinessException;
import br.com.o2solutions.core.service.rule.Rule;
import br.com.o2solutions.core.test.model.ModelTest;
import br.com.o2solutions.util.assertion.Assert;

@Component
public class UpdateRule implements Rule<ModelTest> {

	@Override
	public void check(ModelTest entity) throws BusinessException {
		Assert.isTrue(entity.getId() != null, new BusinessException(
				"O id para atualizacao nao pode ser nulo"));
	}

}